18. Check for Understanding: Data Structures
Check for Understanding
Let's pause again to do a quick check for understanding.
SOLUTION:
- A tuple is an ordered data structure.
- A tuple can be indexed and sliced like a list.
SOLUTION:
- A set is a mutable data structure.
- A set does not contain duplicate elements.
SOLUTION:
FalseSOLUTION:
- A dictionary is a mutable data structure.
- A dictionary can be indexed using keys.
- The keys of a dictionary are unique.
Quiz: Identify the Problem
Run the code below - it should break. Take a look at the error message and try to figure out what the issue is. Then, answer the quiz question below the editor.
Start Quiz:
# invalid dictionary - this should break
room_numbers = {
['Freddie', 'Jen']: 403,
['Ned', 'Keith']: 391,
['Kristin', 'Jazzmyne']: 411,
['Eugene', 'Zach']: 395
}